<form class="form-inline" method="get">
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="user_condition" value="{$user_condition}"
                   placeholder="会员手机|昵称|ID">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="or_condition" value="{$or_condition}"
                   placeholder="订单ID|订单号">
        </div>
    </div>

    <div class="form-group col-xs-4">
        <div class="col-xs-12">
            <span style="">下单时间</span>{include file="public/dateRangePicker" picker-name="time_range" /}
        </div>
    </div>

    <div class="form-group col-xs-2" style="width: 5%">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                搜索
            </button>
        </div>
    </div>
</form>
<hr>
<table class="table table-bordered table-striped">
    <caption>金额统计</caption>
    <thead>
        <tr>
            <th>总金额</th>
            <th>现金</th>
            <th>{:config('coin_title')}抵扣</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>{$all.all_price}</td>
            <td>{$all.all_money}</td>
            <td>{$all.all_coin}</td>
        </tr>
    </tbody>
</table>

<hr>

<table class="table table-bordered table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>买家</td>
        <td>订单号</td>
        <td>订单金额</td>
        <td>订单状态</td>
        <td>支付</td>
        <td>发货信息</td>
        <td>创建时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td style="text-align: left">
            <p>ID：<label class="label label-primary">{$item.uid}</label></p>
            <p>昵称：{$item.nick_name}</p>
            <p>手机：<label class="label label-success">{$item.mobile}</label></p>
        </td>
        <td>{$item.order_sn}</td>
        <td>
            <p>总金额：{$item.total_price}</p>
            <p>商品金额：{$item.goods_price}</p>
            <p>运费：{$item.dispatch_price}</p>
            <p>应付金额：{$item.money}</p>
        </td>
        <td>
            {if $item['status']==0}
            <label class="label label-info">未支付</label>
            {elseif $item['status']==1}
            <label class="label label-success">待发货</label>
            {elseif $item['status']==2}
            <label class="label label-warning">待收货</label>
            {elseif $item['status']==3}
            <label class="label label-default">已完成</label>
            {elseif $item['status']==-1}
            <label class="label label-danger">已取消</label>
            {else}
            无效订单
            {/if}
        </td>
        <td>
            {if $item['status']>0}
            <p>支付金额：{$item.pay_money}</p>
            <p>支付时间：{$item.pay_time|show_datetime}</p>
            {/if}
        </td>
        <td>
            <p>收货人：{$item.send_name}</p>
            <p>联系方式：{$item.send_mobile}</p>
            <p>收货地址：{$item.send_address}</p>
            {if $item.status>=2}
            <p>快递：{$item.send_company}</p>
            <p>快递单号：{$item.send_sn}</p>
            <p>发货时间：{$item.send_time|show_datetime}</p>
            {/if}
            {if $item.status>=3}
            <p>收货时间：{$item.receive_time|show_datetime}</p>
            {/if}
        </td>
        <td>
            <p>{$item.create_time|show_datetime}</p>
        </td>

        <td>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    操作
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li>
                        <a href="javascript:void(0)" onclick="modal('{:url(\'order_info\',array(\'id\'=>$item[\'id\']))}', '订单详情' ,'80%','90%')">
                            订单详情
                        </a>
                    </li>
                    {if $item['status']==2}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="确认收货"
                           data-content="操作不可逆，谨慎操作，确认收货？"
                           data-url="{:url('confirm_receive',array('id'=>$item['id'],'uid'=>$item['uid']))}">
                            确认收货
                        </a>
                    </li>
                    {/if}
                    {if $item['status']==1}
                    <li>
                        <a href="javascript:void(0)" onclick="modal('{:url(\'send\',array(\'id\'=>$item[\'id\']))}', '确认发货','60%','60%')">
                            确认发货
                        </a>
                    </li>
                    {/if}

                    {if $item['status']==-1}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="删除订单"
                           data-content="订单将会被删除，确认删除？"
                           data-url="{:url('remove',array('id'=>$item['id']))}">
                            删除
                        </a>
                    </li>
                    {/if}

                    <li role="separator" class="divider"></li>
                </ul>
            </div>
        </td>

    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {
        /*修改标题*/
        var title="{$templateTitle}";
        $(".dakq-nav-title").text(title);
    });
</script>